<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="pragma" content="no-cache"/>
    <meta http-equiv="cache-control" content="no-cache"/>
    <meta http-equiv="expires" content="0"/>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
    <meta http-equiv="description" content="This is my page"/>

    <link rel="stylesheet" type="text/css" href="<%=path %>/css/base.css"/>

    <script type='text/javascript' src='<%=path %>/dwr/interface/catelogService.js'></script>
    <script type='text/javascript' src='<%=path %>/dwr/engine.js'></script>
    <script type='text/javascript' src='<%=path %>/dwr/util.js'></script>
    <script type="text/javascript" src="<%=path %>/js/popup.js"></script>

    <script language="javascript">
        var i = 0;
        function goodsCatelogSelect() {
            if (i == 0) {
                document.getElementById("indicator").style.display = "block";
                catelogService.findAllCatelog(callback);
                i = 1;
            }

        }

        function callback(data) {
            document.getElementById("indicator").style.display = "none";
            //document.getElementById("goodsCatelogId1").style.display="none";
            DWRUtil.addOptions("goodsCatelogId", data, "catelogId", "catelogName");
            //document.getElementById("goodsCatelogId").style.display="block";
        }

        function up() {
            var pop = new Popup({contentType: 1, isReloadOnClose: false, width: 400, height: 200});
            pop.setContent("contentUrl", "<%=path %>/upload/upload.jsp");
            pop.setContent("title", "文件上传");
            pop.build();
            pop.show();
        }


        function check() {
            if (document.formAdd.goodsCatelogId.value == 0) {
                alert("请选择类别");
                return false;
            }
            if (document.formAdd.goodsName.value == "") {
                alert("请填写商品名称");
                return false;
            }
            if (document.formAdd.goodsShichangjia.value == "") {
                alert("请填写商品价格");
                return false;
            }
            if (document.formAdd.goodsTejia.value == "") {
                alert("请填写商品特价");
                return false;
            }
            document.formAdd.submit();
        }
    </script>
</head>

<body leftmargin="2" topmargin="9" background='<%=path %>/images/allbg.gif'>
<form action="<%=path %>/goodsNoTejiaUpdate.action" name="formAdd" method="post" enctype="multipart/form-data">
    <table width="98%" align="center" border="0" cellpadding="4" cellspacing="1" bgcolor="#CBD8AC"
           style="margin-bottom:8px">
        <tr bgcolor="#EEF4EA">
            <td colspan="3" background="<%=path %>/images/wbg.gif" class='title'><span>产品编辑</span>
                <input type="hidden" name="goodsId" id="goodsId" value='<s:property value="#request.goods.goodsId"/>'/>
            </td>
        </tr>
        <tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';"
            onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
            <td width="30%" bgcolor="#FFFFFF" align="right">
                产品名称：
            </td>
            <td width="70%" bgcolor="#FFFFFF" align="left">
                <input type="text" name="goodsName" value='${data.product_name}' size="20"/>
            </td>
        </tr>
        <tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';"
            onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
            <td width="30%" bgcolor="#FFFFFF" align="right">
                产品描述：
            </td>
            <td width="70%" bgcolor="#FFFFFF" align="left">
                <input type="text" name="goodsDetail" value='${data.product_detail}' size="100"/>
                <%--<FCK:editor instanceName="goodsMiaoshu" basePath="/fckeditor" width="500" height="200"--%>
                <%--toolbarSet="Basic">--%>
                <%--<jsp:attribute name="value">--%>
                <%--<s:property value="#request.goods.goodsMiaoshu" escape="false"/>--%>
                <%--</jsp:attribute>--%>
                <%--</FCK:editor>--%>
            </td>
        </tr>
        <tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';"
            onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
            <td width="30%" bgcolor="#FFFFFF" align="right">
                商品图片：
            </td>
            <td width="70%" bgcolor="#FFFFFF" align="left">
                <input type="text" name="fujian" id="fujian" size="30" readonly="readonly"
                       value='${data.picture_id}'/>
                <input type="button" value="上传" onclick="up()"/>
                <input type="hidden" name="fujianYuanshiming" id="fujianYuanshiming"/>
                <img src='/wlgw${data.picture_id}'/>
            </td>
        </tr>
        <tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';"
            onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
            <td width="30%" bgcolor="#FFFFFF" align="right">
                价格：
            </td>
            <td width="70%" bgcolor="#FFFFFF" align="left">
                <input type="text" name="goodsShichangjia" size="20" onkeyup="this.value=this.value.replace(/\D/g,'')"
                       onafterpaste="this.value=this.value.replace(/\D/g,'')"
                       value='${data.price}'/>
            </td>
        </tr>
        <tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';"
            onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
            <td width="30%" bgcolor="#FFFFFF" align="right">
                目标数量：
            </td>
            <td width="70%" bgcolor="#FFFFFF" align="left">
                <input type="text" name="goodsKucun" size="20" onkeyup="this.value=this.value.replace(/\D/g,'')"
                       onafterpaste="this.value=this.value.replace(/\D/g,'')"
                       value='${data.purpose}'/>
            </td>
        </tr>
        <tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';"
            onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
            <td width="30%" bgcolor="#FFFFFF" align="right">
                &nbsp;
            </td>
            <td width="70%" bgcolor="#FFFFFF" align="left">
                <input type="button" value="提交" onclick="check()"/>&nbsp;
                <input type="reset" value="重置"/>&nbsp;
            </td>
        </tr>
    </table>
</form>
</body>
</html>
